/**
 * 
 */
package edu.iss.demo.model;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;

/**
 * @author Sachin
 *
 */
@Entity
@Table(name="public_holiday_tbl")
public class PublicHoliday implements Comparable<PublicHoliday>{

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private long publicHolidayid;
	
	@DateTimeFormat(pattern = "MM/dd/yyyy")
	private Date date;
	private String name;
	private boolean deleteFlag;
	@OneToOne
	private UserDetail userId;
	
	
	public long getPublicHolidayid() {
		return publicHolidayid;
	}
	public void setPublicHolidayid(long publicHolidayid) {
		this.publicHolidayid = publicHolidayid;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public UserDetail getUserId() {
		return userId;
	}
	public void setUserId(UserDetail userId) {
		this.userId = userId;
	}
	@Override
	public int compareTo(PublicHoliday o) {
		// TODO Auto-generated method stub
		// need to impplement if needed in future
		return 0;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ (int) (publicHolidayid ^ (publicHolidayid >>> 32));
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PublicHoliday other = (PublicHoliday) obj;
		if (publicHolidayid != other.publicHolidayid)
			return false;
		return true;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public boolean isDeleteFlag() {
		return deleteFlag;
	}
	public void setDeleteFlag(boolean deleteFlag) {
		this.deleteFlag = deleteFlag;
	}
	
	
	
	
}
